package com.lyq.homework.planA;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;



// fiel1  : 1,2,3,4
//fiel2  : 5,6,7,8
//fiel3: 9,10,11

// map 输入 -》 key ： 一行一个数字  value : 数字
// map 输出 key 为 数字 ；value ->null

public class NumSortingAMapper extends Mapper<LongWritable, Text,LongWritable, NullWritable> {

    LongWritable longWritable = new LongWritable();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        longWritable.set(Long.parseLong(value.toString()));
        context.write(longWritable,NullWritable.get());
    }
}
